﻿@model Adams.Web.Models.Home.Index.PageLoad
@{
    Layout = "~/Views/Shared/_HomeLayout.Mobile.cshtml";
    ViewBag.Title = "ADAMS";
}
@section Head{
}
<a href="/Donate" data-role="button" data-theme="e">Please Donate</a>
<div data-role="collapsible">
    <h3>
        Today's Prayer Times</h3>
    <div class="ui-grid-b">
        <div class="ui-block-a">
            Prayer</div>
        <div class="ui-block-b">
            Adhan</div>
        <div class="ui-block-c">
            Iqama</div>
    </div>
    <div class="ui-grid-b">
        <div class="ui-block-a">
            Fajr</div>
        <div class="ui-block-b">
            @Model.PrayerTime.Fajr</div>
        <div class="ui-block-c">
            @Model.PrayerTime.FajrIqama</div>
    </div>
    <div class="ui-grid-b">
        <div class="ui-block-a">
            Sunrise</div>
        <div class="ui-block-b">
            @Model.PrayerTime.Sunrise</div>
        <div class="ui-block-c">
        </div>
    </div>
    <div class="ui-grid-b">
        <div class="ui-block-a">
            Duhr</div>
        <div class="ui-block-b">
            @Model.PrayerTime.Duhr</div>
        <div class="ui-block-c">@Model.PrayerTime.DuhrIqama</div>
    </div>
    <div class="ui-grid-b">
        <div class="ui-block-a">
            Asr</div>
        <div class="ui-block-b">
            @Model.PrayerTime.Asr</div>
        <div class="ui-block-c">@Model.PrayerTime.AsrIqama</div>
    </div>
    <div class="ui-grid-b">
        <div class="ui-block-a">
            Maghrib</div>
        <div class="ui-block-b">
            @Model.PrayerTime.Maghrib</div>
        <div class="ui-block-c">@Model.PrayerTime.MaghribIqama</div>
    </div>
    <div class="ui-grid-b">
        <div class="ui-block-a">
            Isha</div>
        <div class="ui-block-b">
            @Model.PrayerTime.Isha</div>
        <div class="ui-block-c">@Model.PrayerTime.IshaIqama</div>
    </div>
</div>
@if (DateTime.Now.DayOfWeek == DayOfWeek.Friday && DateTime.Now.Hour < 15)
{
    <div data-role="collapsible">
        <h3>
            Today's Jummah Times
        </h3>
        @foreach (var jlocation in Model.JummahLocations)
        {
            <div class="ui-grid-a">
                <div class="ui-block-a">
                    <a href="/prayers/jummah/@jlocation.Name.Replace(' ', '_')">@jlocation.Name</a></div>
                <div class="ui-block-b">
                    @foreach (var jprayer in jlocation.Prayers)
                    {
                        @jprayer.Time<text> </text>
                    }
                </div>
            </div>
        }
    </div>
}
else if (Adams.Shared.CalendarHelper.GetHijriDate(DateTime.Now.AddDays(-1)).IndexOf("Ramadan") >= 0 && DateTime.Now.Hour > 17)
{
    <div data-role="collapsible">
        <h3>
            Today's Taraweh Times
        </h3>
        @foreach (var tlocation in Model.TarawehLocations)
        {
            <div class="ui-grid-a">
                <div class="ui-block-a">
                    <a href="/prayers/jummah/@tlocation.Name.Replace(' ', '_')">@tlocation.Name</a></div>
                <div class="ui-block-b">
                    @foreach (var tprayer in tlocation.Prayers)
                    {
                        @tprayer.Time<text> </text>
                    }
                </div>
            </div>
        }
    </div>
}
<div data-role="collapsible">
    <h3>
        Announcements</h3>
    @foreach (var announcement in Model.Announcements)
    {
        <p>
            @if (announcement.Link.Length == 0)
            {
                <strong><a href="/announcements/@Adams.Shared.UrlHelper.Enc(announcement.Title)">@announcement.Title</a></strong><br />
            }
            else
            {
                <strong><a href="@announcement.Link">@announcement.Title</a></strong><br />
            }
            <span>@announcement.ShortDescription</span><br />
        </p>
    }
    <a href="/Announcements">more</a>
</div>
<div data-role="collapsible">
    <h3>
        Events</h3>
    @foreach (var evet in Model.Events)
    {
        <p>
            <strong><a href="/events/@evet.ID">@evet.Event.Calendar.Name - @evet.Title</a></strong><br />
            @evet.StartDate.ToShortDateString() - @evet.ShortDescription<br />
        </p>
    }
    <a href="/Events">more</a>
</div>
<div data-role="collapsible">
    <h3>
        Press Releases</h3>
    @foreach (var pressrelease in Model.PressReleases)
    {
        <strong><a href="/pressreleases/@Adams.Shared.UrlHelper.Enc(pressrelease.Title)">@pressrelease.Title</a></strong><br />
        @pressrelease.ShortDescription<br />
    }
    <a href="/PressReleases">more</a>
</div>
<div data-role="collapsible">
    <h3>
        News</h3>
    @foreach (var article in Model.News)
    {
        <strong><a href="/pressreleases/@Adams.Shared.UrlHelper.Enc(article.Title)">@article.Title</a></strong><br />
        @article.ShortDescription<br />
    }
    <a href="/News">more</a></span>
</div>
@section Scripts {
}